home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / coa_12r.zip / COA_ADEV.DOC next >
Text File  |  1988-02-04  |  19KB  |  425 lines

  1. Catacombs of Ascii v 1.2+
  2.  
  3.  
  4.                        Advanced Event Features
  5.                        -----------------------
  6.  
  7.                     + = Event Stack  (OR)
  8.                     & = Event Daisey-Chain  (AND)
  9.                     * = Event and Chain simul. (AND/OR)
  10.  
  11.  
  12.  
  13. This document contains information on using the advanced COA event
  14. features Event Stacking and Event Daisey-Chaining.  If you are new to
  15. COA, and/or have not used events very much in your designs, it is the
  16. author's recomendation that you stay away from these features until you
  17. have given yourself a chance to become familiar with the events. 
  18. Stacking and Chaining greatly enhance the possibilities of event
  19. creation, but they also add a level of complexity -- and errors can
  20. become very difficult to find/correct.
  21.  
  22. With that warning in place, I will do my best to describe Stacking and 
  23. Chaining in the following pages.  These features are new to version 1.2,
  24. so do not be surpised if some anonmalies emerge during actual use.
  25.  
  26.  
  27. EVENT STACKING
  28. --------------
  29.  
  30. Event stacking is a way to create an event that can be triggered multiple 
  31. ways with multiple effects.  One could have an Idol, for instance, that 
  32. kills when attacked but bestows healing if spoken to.
  33.  
  34. This is accomplished by creating a series of events, one after the other, 
  35. which are all linked to the first.  You indicate to the parser that the
  36. current event is `continued on next event' by placing a plus sign (+) in
  37. the rightmost position of the Trigger Parameter field.
  38.  
  39. In other words, a `+' in the Trigger Parameter field means `If this event
  40. does not trigger under the current circumstances, try the next one instead.'
  41.  
  42. The Idol example:
  43.  
  44. #   Desc   Message             Trig    Trig Param      Effect       Tran
  45. 114 IDOL   It attacks you!      A               +    CPS001000      114
  46. 115 IDOL   It heals you!        T                    CPS002000      114
  47.  
  48. The + sign in 114's Trig Param field must be placed in the extreme 
  49. rightmost position of the field.
  50.  
  51. Note that both events Transform into 114.  This is important.  The 
  52. parser looks at the records this way:
  53.  
  54. If player attacks:
  55.         He's attacking #114
  56.         Does 114 respond to A trigger?
  57.         Yes, do effect and transform to 114
  58.  
  59. If player talks:
  60.         He's talking to #114
  61.         Does 114 respond to T trigger?
  62.         No.  It a + present?
  63.         Yes, try next record.
  64.         He's talking to #114, using 115's data
  65.         Does 115 respond to T trigger?
  66.         Yes, do effect and transform to 114.
  67.  
  68. If a player does something else (say, Fire at):
  69.         He's Firing at #114
  70.         Does 114 respond to F trigger?
  71.         No.  It a + present?
  72.         Yes, try next record.
  73.         He's Firing at #114, using 115's data.
  74.         Does 115 respond to F.
  75.         No.  Is a + present?
  76.         No.  No effect, no transform, nothing.
  77.  
  78.  
  79.  
  80. You can see that if 115's Tranform field pointed to 115, then once a 
  81. player spoke the idol it would be transformed forever into 115, which
  82. does not respond to Attack at all.  There may be situations under which
  83. this is desireable, but normally it is not.
  84.  
  85. Also, stacked events must obviously follow in numerical order in the event
  86. database.  They are linked by the + sign only, which tells the parser to
  87. `go on' until and unless it finds a record that can be triggered by the
  88. player's action, or runs out of +'s.
  89.  
  90. You can stack events as deeply as you like.  Really.  In general, follow 
  91. these rules:
  92.  
  93.          All events in the stack should have the + flag, except the last
  94.          one, which must not (for obvious reasons).
  95.           
  96.          All Transform Fields usually point to the first record in the 
  97.          stack.
  98.  
  99.          Only the first record is actually placed in the maze.
  100.  
  101. The first requirement is natural - event stacks continue until a + is not 
  102. found, so naturally the last event in a sequence should not have a +.
  103.  
  104. The second two requirements are `normal' conventions.  If you have
  105. transforms that do other things, many special effects are possible, as
  106. are many problems.  Also, you can place mid-stack events directly in
  107. the maze to create event stacks that are subsets of other stacks, but
  108. again, this can cause problems if you are not careful.
  109.  
  110. Here's another example of an event stack:
  111.  
  112. #   Desc   Message             Trig    Trig Param      Effect       Tran
  113. 104 WAND   It has runes on it   G      POSSESS  +        NIL        104
  114. 105 WAND   A staircase!         X               +   MKT005+00+00+00 104
  115. 106 WAND   The Runes read:      M                   DPFWAND.TXT     104
  116.  
  117. Note that the + can coexist with other trigger parameters as in POSSESS 
  118. above, as well as others.
  119.  
  120. This is a gettable, dual-use wand.  X will cause a staircase to be
  121. formed where the player stands, while M will display the file WAND.TXT
  122. to him.  Note again that all three records transform into 104, to keep
  123. the wand in the same state regardless of how it is used.  The wand may
  124. even be a triple- use wand if some other event requires the player to
  125. have #104 in his possession.
  126.  
  127. Another advantage here is that the wand stays a Gettable object even 
  128. though it has other uses.  Hence, it can be Put by the player, and will
  129. also randomize when he dies.
  130.  
  131. One issue that arises concerning possessed event items is, when are they 
  132. Putable?  Generally, an item may be put if:
  133.  
  134. 1) It has G as it's event trigger.
  135.  
  136. 2) It has P as it's event trigger.
  137.  
  138. 3) The above conditions are not met, yet one of the events stacked below
  139.    this event has P as it's trigger, and the events are linked (using +). 
  140.  
  141. If none of these three conditions is met, the item cannot be put down by
  142. the player.
  143.  
  144. Only an event with G as it's trigger will be randomized when a player 
  145. dies.  A P trigger in the current or linked events does will not 
  146. suffice.  This is to prevent un-gettable objects from cluttering up your 
  147. maze...
  148.  
  149.  
  150. DAISEY CHAINING 
  151. ---------------
  152.  
  153. While Event Stacking allows one event object to have several different 
  154. effects caused by different triggers, Daisey Chaining allows one event 
  155. to have multiple effects from a single trigger.
  156.  
  157. The setup is simple: Place a `&' in the rightmost position of the Trigger
  158. Parameter field.  Now, when the event triggers, if the event transformed
  159. to has the same trigger as the original event, the second event will 
  160. trigger without delay.  This second event may transform into a third,
  161. which may also be instantly triggered if it has the same trigger, etc...
  162.  
  163. In other words, a `&' in the trigger parameter means `If this event
  164. does trigger, and we are transforming to an event that triggers under
  165. the same circumstances, then trigger the next event immediately.'
  166.  
  167. Here is an example:
  168.  
  169. #   Desc   Message             Trig    Trig Param      Effect       Tran
  170. 104 HOLE   You fall in!         O               &   MVP+01+00+00    105
  171. 105 HOLE   You take damage!     O               &   CPS002+01       106
  172. 106 HOLE   You lost something!  O                   CPS005000       104
  173.  
  174. When the player steps on HOLE (104), three things will happen - first he
  175. will be moved one level down, then will take a point of damage, then his
  176. gold will reduced to 0.  Note that the last object in the list tranforms
  177. back to the first: but the absense of the & prevents it from triggering
  178. 104 again and creating an infinite loop.  The system will try and prevent
  179. such loops anyway, by remembering what the first event in the chain was
  180. and so forth, but the final responsbility it up to you.  Don't loop events
  181. back onto themselves!
  182.  
  183. Note that Daisey chaining, unlike event stacking, need not be done with
  184. congtiguous events.  The chained events are linked by the Transform 
  185. Field, so they may be placed anywhere in the event db.  Naturally, it is 
  186. to your advantage to place them together, since this makes debugging 
  187. much easier.
  188.  
  189.  
  190.  
  191. STACKS AND CHAINS: COMPARE/CONTRAST AND COMBINE
  192. -----------------------------------------------
  193.  
  194. One way to more fully understand event stacking and daisey chaining is to
  195. compare them:
  196.  
  197.  > Stacks must be in contiguous records.
  198.  > Chains can leap back and forth across any records.
  199.  
  200.  > Upon triggering, a stack will be searched *until* a record is found
  201.    that will trigger, then *that* record triggers/transforms and the
  202.    stack is terminated.
  203.  > Upon triggering, a chain will trigger *every record* in the chain,
  204.    transforming each to the next, *until* a record is found that cannot
  205.    be triggered, or until the top of the chain is re-joined, or until
  206.    a `*' is not found in the trigger parameter field.
  207.  
  208.  > Both stacks and chains respond to a single trigger.  The player is
  209.    never asked more than once for Talk or CDx information.
  210.  
  211. Another way of looking at it:
  212.    `+' matters if the record is NOT triggered.  It means `try next one'.
  213.    `&' matters if the record IS triggered.  It means `try the one I am
  214.        transforming to also'.
  215.    
  216.    And, as you are about to see, `*' means do BOTH of these things.
  217.  
  218.  
  219. Consider the following examples:
  220.  
  221. The Book
  222. --------
  223.  
  224. #   Desc   Message             Trig    Trig Param      Effect       Tran
  225. 101 BOOK   It is old and worn   G      POSSESS  +       NIL          101
  226. 102 BOOK   It reads thus:       M               +    DPFBOOK.TXT     101
  227. 103 BOOK   A Dagger is created! T      DAGGER   +    MKO001CD1       101
  228. 104 BOOK   A S-Swd is created!  T      SHORT    +    MKO002CD1       101
  229. 105 BOOK   A L-Swd is created!  T      LONG     +    MKO003CD1       101
  230. 106 BOOK   A Space is cleared   T      DESTROY  *    MKT001CD1       135
  231. 107 BOOK   A Wall is created!   T      WALL          MKT000CD1       101
  232.                                     .
  233.                                     .
  234.                                     .
  235. 135 BOOK   All things living &  T      DESTROY  &    DSOCD1          136
  236. 136 BOOK   dead are removed     T      DESTROY       DSMCD1          101
  237.  
  238.  
  239. #101 is placed in the maze, or directly into the possession of a player
  240. using COA_EDIT.
  241.  
  242. Here is a maze-designer tool for designers that maintain their mazes from
  243. a remote location, as a player.  It allows one to create weapons and walls,
  244. and to clear spaces of terrain, objects, and monsters.
  245.  
  246. Once the book is Gotten, only 102 can be triggered as you cannot Talk to
  247. something in your possession.  Therefore, BOOK.TXT, which is displayed if
  248. the player M's the book, should explain that the book should be placed on
  249. the floor and spoken to, with perhaps a list of the words to speak and what
  250. they will do.
  251.  
  252. Note closely event 106.  In order to clear a space, three things must happen;
  253. the terrain must be made 001 (clear), any object there should be destroyed,
  254. and any monster there should be likewise destroyed.  This requires a three-
  255. event chain *if* 106 is the event in the stack that gets triggered, so 106 
  256. transforms to 135, which in turn transforms into 136, which transforms back 
  257. into 101.  Note that since 101 is the object as possessed by the player, it
  258. is the record to transform back into (not 106, which was the head of the
  259. daisey chain).
  260.  
  261. A question that may be on your mind is: How does 106 chain to 135 if
  262. 106 does not have `&' in the trigger parameter field? The system requires
  263. that you use an `*' where both a `+' and a `&' are needed.  In other words,
  264. `*' means `both + and &'.
  265.  
  266. Note that although all three events in the chain (106, 135, 136) have
  267. CD1 in their effect, which causes the system to ask the player for a
  268. direction, the player will only be asked once, upon the first
  269. occurance, and the direction chosen will be applied to all three
  270. events.  Similarly with the Talk triggers throughout the stack and the
  271. chain, the player will only be asked if 101 and 102 fail to trigger,
  272. and then only one time, with his response applied to all talk events
  273. throughout the event stack and chain.
  274.  
  275. (My thanks to Rick Bickmore for the remote designer tool idea - my
  276. example here could easily be expanded to include staircases, secret
  277. doors, chests, etc...  simply by adding items to the stack.)
  278.  
  279.  
  280. A Tree
  281. ------
  282.  
  283. #   Desc   Message             Trig    Trig Param      Effect       Tran
  284. 121 TREE   Dumb Idea...         A               +        NIL        121
  285. 122 TREE   Paint Your Wagon?    T               +        NIL        121
  286. 123 TREE   You climb the tree!  O               &        NIL        124
  287. 124 TREE   An Apple fell!       O               &   MKO135+00+01+00 125
  288. 125 TREE   So did you! Ow!      O                   CPS002+01       121
  289.                                     .
  290.                                     .
  291.                                     .
  292. 135 APPLE  It is nice and ripe  G       POSSESS  +      NIL         135
  293. 136 APPLE  You feel better      C                   CPS002-01       000
  294.  
  295. 121 is placed in the maze.  If a player attacks the tree, not much happens
  296. except the message `Dumb Idea...' is displayed.  If he talks to it, he
  297. gets a stupid joke (anybody get this one?).  If he moves into the same
  298. space as the tree, he activates a three-event chain.  Note that here, un-
  299. like the book, the chain is contiguous with the stack.  Just wanted to show
  300. you that it could be done either way.
  301.  
  302. When 123 is triggered, two things happen - an object (#135) is created next
  303. to the tree, and the player takes a point of damage from falling.  
  304.  
  305. Note that 135 is not part of the original stack or chain.  It is simply a
  306. seperate event that gets created by this one.  If the player then picks
  307. up the apple and eats it, his wound is healed and the apple vanishes (he
  308. ate it, after all).  Cute, huh?
  309.  
  310. Also note that though 123 is part of the stack, it is the *last* record
  311. in the stack and would not normally have a `+'.  Therefore, since it is
  312. the beginning of a chain as well, the `&' is used.  In other words,
  313. though it is part of both a stack and a chain, as in the case of record
  314. 106 of The Book, it does not require both `+' and `&' since it is the
  315. last record of the stack, so `*' is not used.  Confusing? You bet.  But
  316. this only happens when the end of a stack is also the beginning of a
  317. chain.
  318.  
  319. Just remember this: All records of a stack have a `+' except the last
  320. one.  All records of a chain have `&', except the last one.  In any
  321. case where you need both, use `*'.
  322.  
  323.  
  324. The Ore-Cart(s)
  325. ---------------
  326.  
  327. #   Desc   Message             Trig    Trig Param      Effect       Tran
  328. 214 CART   Funny, no answer     T               +       NIL         214
  329. 215 CART   Ah- A chest beneath  A               +       NIL         059
  330. 216 CART   HANG ON!             O               &  MVP+00+10+00     217
  331. 217 CART                        O                  MKO218+00+00+00  000
  332.  
  333. 218 CART   It's a good listener T               +       NIL         218
  334. 219 CART   Ah- A chest beneath  A               +       NIL         059
  335. 220 CART   HANG ON!             O               &  MVP+00-10+00     221
  336. 221 CART                        O                  MKO214+00-00+00  000
  337.  
  338.  
  339. Ah - special effects! Here I break many of the rules I state earlier to
  340. show how tricky but creative effects can be acheived by fiddling with
  341. the tran parameter...
  342.  
  343. 214 is placed in the maze.  If the player tries to Talk to it, not much
  344. happens.  If he attacks it, it transforms into a chest (059, pretty
  345. nice), and the CART event is gone *forever*.  If he gets on/in the
  346. CART, two things happen in the chain that ensues; the player is moved
  347. 10 spaces to the right, and another CART (#218) is created `under' him. 
  348. Note that the chain ends with a transform to 000, destroying this CART
  349. (it has `moved', after all).  
  350.  
  351. Also, it is important to understand why event 217 uses +00+00+00 as
  352. it's location to make the new object, rather than +00+10+00.  Relative
  353. location indexes are relative to the `current` location.  In normal
  354. event triggering, this is the location of the event; but in a stack or
  355. chain, each event is triggered after the previous one is complete, so
  356. the MVP had already changed the `current' location before the MKO was
  357. activated.  MVP is the only sort of event that would cause this.  Had
  358. I placed the MKO *before* the MVP, then I would have used the +00+10+00
  359. string. 
  360.  
  361. 218 is identical, save that it moves the player 10 spaces to the left.
  362.  
  363. Here you can see that one-way stacks and chains do serve a purpose, if
  364. you are careful and test your events thoroughly.  Yeah, I know.  It's
  365. complex.  Well, you can't say I didn't warn you! 
  366.  
  367. Remember these five cardinal rules:
  368.  
  369. 1)  A triggered record always transforms, at least.
  370.  
  371. 2)  A non-triggered record never transforms.
  372.  
  373. 3)  A plus (+) in the Trigger Parameter means:
  374.     `If I do NOT trigger, try the next record in my place.'
  375.  
  376. 4)  An ampersand (&) in the Trigger Parameter means:
  377.     `If I DO trigger, and if the event I am transforming to
  378.     triggers under the SAME circumstances, trigger it now.'
  379.  
  380. 5)  Anytime you need both a plus and an ampersand, use the
  381.     asterisk (*).
  382.  
  383.  
  384. A subtler Example:
  385. -----------------
  386.  
  387. #   Desc   Message             Trig    Trig Param      Effect       Tran
  388. 101 PHOTO  You lose a STR pt.   T      DORIAN   *     CPS001+01      102
  389. 102 PHOTO  You are healed by 1  T               &     CPS002-01      103
  390. 103 PHOTO  and lose 5 turns     T                     CPS000-05      101
  391.  
  392. If a player speaks to the photo, but says something other than DORIAN:
  393.            1 - 101 does not trigger, but * works like a + so check next.
  394.            2 - 102 does trigger, so heal 1 point.  Transform to 103,
  395.                and since & is present try to trigger 103 immediately.
  396.            3 - 103 does trigger, so lose 5 turns.  Transform to 101,
  397.                but since no & do not try to trigger 101.
  398.  
  399. Remember that Talk with no trigger param means `trigger on any Talk'.
  400.  
  401. If a player speaks to the photo, and does say DORIAN:
  402.            1 - 101 does trigger, so reduce STR by 1.  Transform to 102, 
  403.                and since * also works like a &, attempt to trigger it.
  404.            2 - 102 does trigger - Talk any, right?  So heal a point,
  405.                and transform to 103.  Since & is present,  attempt
  406.                to trigger it.
  407.            3 - 103 does trigger, so reduce turns by five.  No & is
  408.                present, so transform to 101 but do not attempt trigger.
  409.  
  410. If the player does anything else:
  411.            1 - 101 does not trigger, but * indicates a + so check next.
  412.            2 - 102 does not trigger, and & does not matter if the record
  413.                is un-triggered.  No +, so stop here and quit, no trans-
  414.                form, no effect, nothing done.
  415.            
  416.  
  417.                                                       -Scott Bain-
  418.                                                   The Scanline Remote
  419.                                                      (619)298-2023
  420.                                                      300/1200/2400
  421.  
  422.  
  423.  
  424.  
  425.